package cn.jeeweb.web.modules.sys.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.jeeweb.common.annotate.UiPropertyField;
import java.lang.String;
import java.util.Date;

import cn.jeeweb.common.flag.ObjectMark;
import cn.jeeweb.common.mvc.entity.DataEntity;
import cn.xjzn.framework_Core.ControlType;
import cn.xjzn.framework_Core.ModuleServe;
import cn.xjzn.framework_Core.StaticControl;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;

/**
 * @Title 用户实体
 * @Description:
 */

@TableName("sys_user")
@SuppressWarnings("serial")
public class User extends DataEntity<String> implements ObjectMark {

	/**
	 * 是否锁定（1：正常；-1：删除；0：锁定；）
	 */
	public static final String STATUS_DELETE = "-1";
	public static final String STATUS_LOCKED = "0";
	public static final String STATUS_NORMAL = "1";

	// 姓名
	@Excel(name = "用户名", orderNum = "1")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "username",labelText="用户名",canBeNull=false)
	private String username;
	// 用户名
	@Excel(name = "姓名", orderNum = "0")
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "realname",labelText = "姓名")
	private String realname;
	// 头像
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "portrait",labelText = "头像")
	private String portrait;
	@TableField(exist = false)
	private Organization organization;
	// 密码
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "password",labelText = "密码")
	private String password;
	// 加密因子
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "salt",labelText = "salt",canDisplay = false,isDisplayAsSearchResult = false)
	private String salt;
	// 邮件
	@Excel(name = "邮件", orderNum = "3", width = 20.0D)
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "email",labelText = "邮件")
	private String email;
	// 联系电话
	@Excel(name = "联系电话", orderNum = "2", width = 20.0D )
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "phone",labelText = "联系电话")
	private String phone;

	@TableField(value = "sex")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "sex",labelText = "性别")
	private String sex;
	@TableField(value = "birthday")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "birthday",labelText = "生日")
	private Date birthday;
	@TableField(value = "education")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "education",labelText = "教育程度")
	private String education;
	@TableField(value = "professional")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "professional",labelText = "专业")
	private String professional;
	@TableField(value = "is_working")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "isWorking",labelText = "在职状态")
	private String isWorking;
	@TableField(value = "post")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "post",labelText = "职务")
	private String post;
	@TableField(value = "job_level")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "jobLevel",labelText = "工种")
	private String jobLevel;
	@TableField(value = "joining_date")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "joiningDate",labelText = "入职日期")
	private Date joiningDate;
	@TableField(value = "resume")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "resume",labelText = "简介")
	private String resume;
	@TableField(value = "training_resume")
	@UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "trainingResume",labelText = "培训技能")
	private String trainingResume;
	public void setDefault(){
		this.status = STATUS_NORMAL;
	}
	/**
	 * 系统用户的状态
	 */
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "status",labelText = "状态")
	private String status = STATUS_NORMAL;
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "code",labelText = "工号")
	private String code;//工号
    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "allowLogin",labelText = "是否允许登录")
	private String allowLogin;//是否允许登录

	@TableField(exist = false)
	private String[] organizationIds;//组织机构ids

    @TableField(exist = false)
    private String[] roleIdArray;//角色ids

	@TableField(exist = false)
	private String roleIds;//角色ids

	@TableField(exist = false)
	private String roleNames;//角色ids

    @UiPropertyField(moduleId = ModuleServe.personModule,propertyName = "isSys",labelText = "是否系统控制",controlType = ControlType.DICTSELECTCONTROL,staticControl = StaticControl.SINGLEELECTIONSTATICCONTROL)
	private String isSys;

	@TableField(exist = false)
	private String[] emails;


	/**
	 * 获取 username
	 *
	 * @return: String username
	 */
	public String getUsername() {
		return this.username;
	}

	/**
	 * 设置 username
	 *
	 * @param: username
	 *             username
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * 获取 password
	 *
	 * @return: String password
	 */
	public String getPassword() {
		return this.password;
	}

	public String getPortrait() {
		return portrait;
	}

	public void setPortrait(String portrait) {
		this.portrait = portrait;
	}

	/**
	 * 设置 password
	 *
	 * @param: password
	 *             password
	 */
	public void setPassword(String password) {
		this.password = password;
	}


	/**
	 * 获取 salt
	 *
	 * @return: String salt
	 */
	public String getSalt() {
		return this.salt;
	}

	/**
	 * 设置 salt
	 *
	 * @param: salt
	 *             salt
	 */
	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getCredentialsSalt() {
		return username + salt;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getProfessional() {
		return professional;
	}

	public void setProfessional(String professional) {
		this.professional = professional;
	}

	public String getIsWorking() {
		return isWorking;
	}

	public void setIsWorking(String isWorking) {
		this.isWorking = isWorking;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public String getJobLevel() {
		return jobLevel;
	}

	public void setJobLevel(String jobLevel) {
		this.jobLevel = jobLevel;
	}

	public Date getJoiningDate() {
		return joiningDate;
	}

	public void setJoiningDate(Date joiningDate) {
		this.joiningDate = joiningDate;
	}

	public String getResume() {
		return resume;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	public String getTrainingResume() {
		return trainingResume;
	}

	public void setTrainingResume(String trainingResume) {
		this.trainingResume = trainingResume;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getAllowLogin() {
		return allowLogin;
	}

	public void setAllowLogin(String allowLogin) {
		this.allowLogin = allowLogin;
	}

	public String getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(String roleIds) {
		this.roleIds = roleIds;
	}

	public String getRoleNames() {
		return roleNames;
	}

	public void setRoleNames(String roleNames) {
		this.roleNames = roleNames;
	}

	public String getIsSys() {
		return isSys;
	}

	public void setIsSys(String isSys) {
		this.isSys = isSys;
	}

	public String[] getOrganizationIds() {
		return organizationIds;
	}

	public void setOrganizationIds(String[] organizationIds) {
		this.organizationIds = organizationIds;
	}

	public String[] getEmails() {
		return emails;
	}

	public void setEmails(String[] emails) {
		this.emails = emails;
	}

    public String[] getRoleIdArray() {
        return roleIdArray;
    }

    public void setRoleIdArray(String[] roleIdArray) {
        this.roleIdArray = roleIdArray;
    }

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}
}
